/**
 * @author: zxb
 * @date: 2024-07-25 
 * @des : 用户路由
 * @router: /user/login
 **/ 

const Router = require('koa-router');

const { register, login, updatePassword } = require('../controller/user.controller');
const { userCheck, passwordBcryptjs } = require('../middleware/user.middleware')
const { auth } = require('../middleware/auth.middleware');

const router = new Router({ prefix: '/user' });
router.post('/register', userCheck, passwordBcryptjs, register); // 注册
router.post('/login', userCheck, login); // 登录
router.post('/updatePassword', auth, passwordBcryptjs, updatePassword); // 修改密码

module.exports = router;